//
//  BusinessController.m
//  LiquorChain
//
//  Created by apple on 2019/1/5.
//  Copyright © 2019年 王冬. All rights reserved.
//

#import "BusinessController.h"
#import <WebKit/WebKit.h>
#import "BusEnterController.h"

@interface BusinessController ()
@property (nonatomic,strong) WKWebView *webView;
@end

@implementation BusinessController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.title = @"商家入驻";
    self.view.backgroundColor = BACKGROUNDCOLOR;
    self.webView =[[WKWebView alloc]initWithFrame:CGRectMake(0, kNavBarHeight, SCREEN_WIDTH, SCREEN_HEIGHT - kNavBarHeight- kIPhoneXBottomHeight -50)];
    
    NSMutableURLRequest *request =[NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://www.baidu.com/"]];
    // 3.加载网页
    [self.webView loadRequest:request];
    
    // 最后将webView添加到界面
    [self.view addSubview:self.webView];
    UIButton *commitbtn =[UIButton buttonWithType:UIButtonTypeCustom];
    [self.view addSubview:commitbtn];
    [commitbtn setTitle:@"商家入驻" forState:UIControlStateNormal];
    [commitbtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    commitbtn.backgroundColor = RGBA(240, 208, 131, 1);
    [commitbtn addTarget:self action:@selector(commitClick:) forControlEvents:UIControlEventTouchUpInside];
    commitbtn.titleLabel.font =[UIFont systemFontOfSize:15];
    [commitbtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.mas_equalTo(-kIPhoneXBottomHeight);
        make.left.right.mas_equalTo(0);
        make.height.mas_equalTo(50);
    }];
    
    // Do any additional setup after loading the view.
}
-(void)commitClick:(UIButton *)sender{
    BusEnterController *busVC =[[BusEnterController alloc]init];
    
    [self.navigationController pushViewController:busVC animated:YES];
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
